//
//  BLSearchBarTool.m
//  liangyi
//
//  Created by 张水 on 16/12/26.
//  Copyright © 2016年 yswh. All rights reserved.
//

#import "BLSearchBarTool.h"
@interface BLSearchBarTool ()


@end

@implementation BLSearchBarTool

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor ColorWithHex:@"#5dcedb"];

        [self setupUI];
        
    }
    return self;
}

- (void)setupUI{
    
    UIView *searchView = [[UIView alloc]initWithFrame:CGRectMake(KMAGIN, KTOPMARGIN, KSCREEN_WIDTH-KSENDWIDTH-2*KMAGIN-KSPACING, 30)];
    searchView.backgroundColor = [UIColor whiteColor];
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 20, 20)];
    imageView.image = [UIImage imageNamed:@"leave"];
    
    IWTextView *textView = [[IWTextView alloc]initWithFrame:CGRectMake(30, 0, searchView.frame.size.width-30, 30)];
    self.textView = textView;
    textView.font = [UIFont systemFontOfSize:16];
    
    [searchView addSubview:imageView];
    [searchView addSubview:textView];
    UIButton *sendBtn = [[UIButton alloc]initWithFrame:CGRectMake(KSCREEN_WIDTH-KMAGIN-KSENDWIDTH, KTOPMARGIN, 50, 30)];
    self.sendBtn = sendBtn;
    self.sendBtn.backgroundColor = [UIColor whiteColor];
    [sendBtn setTitle:@"发送" forState:UIControlStateNormal];
    [sendBtn setTitleColor:[UIColor ColorWithHex:@"#878787"] forState:UIControlStateNormal];
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:15];

    [self addSubview:searchView];
    [self addSubview:sendBtn];
    
}

- (void)layoutSubviews{
    [super layoutSubviews];
}
- (void)dealloc{

}
@end
